package String类;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

/**
 * [类名称][功能描述]
 *
 * @author
 * @version [版本], 创建时间:   更新时间:
 */
public class Date {
    public static void main(String[] args) {
        LocalDateTime loc = LocalDateTime.now();
        LocalDate localDate = LocalDate.now();
        LocalTime localTime = LocalTime.now();
        System.out.println(loc);
        System.out.println(localDate);
        System.out.println(localTime);
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd  HH-mm-ss");
        String format = dateTimeFormatter.format(loc);
        System.out.println("格式化"+format);
    }
}
